/// <reference name="MicrosoftAjax.js" path="../MicrosoftAjax.js" />
/// <reference name="jquery-1.4.4-vsdoc.js" path="../jquery-1.4.4-vsdoc.js" />


(function (n) {
    var $toolbox = n.$toolbox = new Object();

    $toolbox.alert = function (title, message) {
        $("#dialogContent").html(message);
        $("#dialog").dialog({
            model: true,
            title: title,
            buttons: {
                Ok: function () {
                    $(this).dialog("close");
                }
            }
        });
    };

    $toolbox.popup = function (title, url, message, width, height, buttons) {
        var _options = {};
        _options.model = true;
        _options.title = title;
        _options.width = (typeof (width) == 'undefined') ? 800 : width;
        _options.height = (typeof (height) == 'undefined') ? 600 : width;
        if (typeof (url) != 'undefined') {
            _options.open = function (event, ui) { $("#dialogContent").load(url, function (e) { }); }
        }
        if (typeof (buttons) != 'undefined') {
            _options.buttons = buttons;
        }
        else {
            _options.buttons =
            {
                Ok: function () {
                    $(this).dialog("close");
                }
            }
        }
        $("#dialog").dialog(_options);
    };


})(window);
